﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.Core.Extensions;

namespace MethodWorx.CMS.Workflow
{
    public static class IWorkflowComponentExtensions
    {
        public static string ParseString(this IWorkflowComponent component, string input, Dictionary<string, string> values)
        {
            if(input != null)
            {
                foreach (var variable in values.Keys)
                {
                    input = input.Replace("{" + variable + "}", values[variable], StringComparison.OrdinalIgnoreCase);
                }
            }

            return input;
        }
    }
}
